//
//  PYExtraSpaceLabel.swift
//  ltsp
//
//  Created by jyvyi_ios on 2022/10/9.
//

import UIKit

class PYExtraSpaceLabel: UILabel {

    var edgeInsets : UIEdgeInsets
    
    init(with edgeInsets:UIEdgeInsets){
        
        self.edgeInsets = edgeInsets
        
        super.init(frame: .zero)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override var intrinsicContentSize: CGSize{
        get{
            let oldSize = super.intrinsicContentSize
            return CGSize.init(width: oldSize.width + edgeInsets.top + edgeInsets.bottom, height: oldSize.height + edgeInsets.left + edgeInsets.right)
        }
    }

}
